<template>
  <div class="search-box">
    <p class="head_query">查询</p>
    <div class="search">
      <!-- <p>制单时间：</p><el-input v-model="input" placeholder="请输入菜品名称"></el-input> -->
      <p>制单时间：</p>
      <el-date-picker v-model="time" type="date" placeholder="选择日期">
      </el-date-picker>
      <el-button type="primary" @click="search">查询</el-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      time: ""
    };
  },
  methods: {
    async search() {
      try {
        const { data: res } = await this.axios.post("/stockCheck/list", {
          time: this.time,
        });
        if (res.code == 200) {
            console.log(res.data);
          let sta = res.data;
          let count = res.count;
          this.$emit('sear',{sta:sta,count:count,time:this.time})
        }
      } catch (error) {
        console.error(error);
      }
    },
  },
};
</script>

<style lang="less" scoped>
* {
  font-family: "微软雅黑";
  font-weight: 400;
  color: "#333";
}
.search-box {
  height: 11.5rem;
  border: 1px solid #dbe0e9;
  .head_query {
    display: block;
    font-weight: normal;
    font-size: 1.6rem;
    font-style: normal;
    height: 4.5rem;
    display: flex;
    align-items: center;
    padding-left: 2rem;
    background: #f2f2f2;
    border-bottom: 1px solid #dbe0e9;
  }

  .search {
    background: #fff;
    height: 7rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #dbe0e9;
    padding-left: 3.5rem;
    p {
      display: inline-block;
      font-size: 1.4rem;
    }
    .el-date-picker {
      width: 20%;
    }
    // 查询按钮
    .el-button {
      padding: 1rem 2rem;
      margin-left: 2rem;
    }
  }
}
</style>